package drds.common.db.xml_mapping.parameter_and_result_value_type;

import java.sql.Date;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;


public class SqlDateTypeHandler extends BaseTypeHandler<Date> {

  @Override
  public void setNonNullParameter(PreparedStatement preparedStatement, int index, Date parameter, JdbcType jdbcType)
    throws SQLException {
    preparedStatement.setDate(index, parameter);
  }

  @Override
  public Date getNullableResult(ResultSet resultSet, String columnName)
    throws SQLException {
    return resultSet.getDate(columnName);
  }

  @Override
  public Date getNullableResult(ResultSet resultSet, int columnIndex)
    throws SQLException {
    return resultSet.getDate(columnIndex);
  }


}
